package org.dialMsg.Mapper;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dialMsg.Pojo.DataSourceBatchDetail;
import org.dialMsg.Pojo.RobotExecLog;
import org.dialMsg.Pojo.TDataSourceBatch;
import org.dialMsg.Pojo.TDialResult;

import java.util.List;

/**
 * @author DPF
 */
@Mapper
public interface TDataSourceBatchMapper {
    void insertTDataSourceBatch(TDataSourceBatch tDataSourceBatch);
    void insertDataSourceBatchDetails(@Param("tDataSourceBatch") TDataSourceBatch tDataSourceBatch,  @Param("dataSourceBatchDetails") List<DataSourceBatchDetail> dataSourceBatchDetails);
    void insetDialResults(@Param("dataSourceBatchDetail") DataSourceBatchDetail dataSourceBatchDetail, List<TDialResult> tDialResults);
    // 根据 ID 查询数据
    @Select("select * from t_data_source_batch where id = #{id}")
    TDataSourceBatch selectById(Integer id);

    // 查询所有数据
    List<TDataSourceBatch> selectAll();
    @Select("select * from t_data_source_batch where show_name like \"%dpf批次-%\" order by id desc limit #{size}")
    List<TDataSourceBatch> queryBySize(Integer size);
    // 更新数据
    int update(TDataSourceBatch dataSourceBatch);

    // 根据 ID 删除数据
    int deleteById(Integer id);

}

